<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('index')}">材料列表</a></li>
			<li class="active"><a href="">添加</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="">
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>公司名称</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-name" required name="name">
				</div>
			</div>
			<div class="form-group">
				<label for="input-reg_time" class="col-sm-2 control-label"><span class="form-required">*</span>注册日期</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control js-bootstrap-date" id="input-reg_time" required name="reg_time">
				</div>
			</div>
			<div class="form-group">
				<label for="select-type" class="col-sm-2 control-label"><span class="form-required">*</span>注册类型</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="type" id="select-type" required>
						<option value="1">内资公司</option>
						<option value="2">香港公司</option>
					</select>
				</div>
			</div>
			<div class="domestic">
				<div class="form-group">
					<label for="input-corporation" class="col-sm-2 control-label"><span class="form-required">*</span>法人</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-corporation" required name="corporation">
					</div>
				</div>
				<div class="form-group">
					<label for="input-registered_capital" class="col-sm-2 control-label"><span class="form-required">*</span>注册资金</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-registered_capital" required name="registered_capital">
					</div>
				</div>
				<div class="form-group">
					<label for="input-annual_audit_time" class="col-sm-2 control-label">成本</label>
					<div class="col-md-6 col-sm-10">
						<volist name="types" id="vo">
							<eq name="vo.cid" value="1">
								<div class="input-group">
									<div class="input-group-addon">{$vo.name}</div>
									<input type="number" class="form-control" name="cost[1][{$vo.id}]">
								</div>
							</eq>
						</volist>
					</div>
				</div>
			</div>
			<div class="hongkong" style="display: none;">
				<div class="form-group">
					<label for="input-no" class="col-sm-2 control-label"><span class="form-required">*</span>公司编号</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-no" required name="no">
					</div>
				</div>
				<div class="form-group">
					<label for="input-annual_audit_time" class="col-sm-2 control-label"><span class="form-required">*</span>年审时间</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control js-bootstrap-date" id="input-annual_audit_time" required name="annual_audit_time">
					</div>
				</div>
				<div class="form-group">
					<label for="input-shareholder" class="col-sm-2 control-label">股东</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-shareholder" name="shareholder">
					</div>
				</div>
				<div class="form-group">
					<label for="input-director" class="col-sm-2 control-label">董事</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-director" name="director">
					</div>
				</div>
				<div class="form-group">
					<label for="input-address" class="col-sm-2 control-label">联系地址</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-address" name="address">
					</div>
				</div>
				<div class="form-group">
					<label for="input-tel" class="col-sm-2 control-label">联系电话</label>
					<div class="col-md-6 col-sm-10">
						<input type="text" class="form-control" id="input-tel" name="tel">
					</div>
				</div>
				<div class="form-group">
					<label for="input-annual_audit_time" class="col-sm-2 control-label">消费</label>
					<div class="col-md-6 col-sm-10">
						<volist name="types" id="vo">
							<eq name="vo.cid" value="2">
								<div class="input-group">
									<div class="input-group-addon">{$vo.name}</div>
									<input type="number" class="form-control" name="cost[2][{$vo.id}]">
								</div>
							</eq>
						</volist>
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary js-ajax-submit">添加</button>
					<a class="btn btn-default" href="javascript:history.back(-1);">返回</a>
				</div>
			</div>
		</form>
	</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
	$(function(){
        change_type();
        $('#select-type').change(change_type);
	})
	function change_type() {
        switch($('#select-type').val()) {
			case "1":
			    $('.domestic').show();
			    $('.hongkong').hide();
			    break;
			case "2":
                $('.domestic').hide();
                $('.hongkong').show();
			    break;
		}
	}
</script>
</body>
</html>